<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <head th:include="common :: header"></head>
    <!--Font Awesome [ OPTIONAL ]-->
    <link th:href="@{/assets/css/magic-check.min.css}" rel="stylesheet">
    <!-- Bootstrap-fileinput -->
    <link th:href="@{/plugins/bootstrap-fileinput/css/fileinput.min.css}" rel="stylesheet">
</head>

<body>
<div id="page-content">

    <div class="row">
        <div class="col-lg-12">
            <div class="panel">
                <input id="upload" type="file" name="files" multiple />
            </div>
        </div>
    </div>


</div>
<!-- END SETTINGS -->
<div th:include="common :: script"></div>
<!-- Bootstrap-fileinput -->
<script th:src="@{/plugins/bootstrap-fileinput/js/fileinput.min.js}"></script>
<script th:src="@{/plugins/bootstrap-fileinput/js/locales/zh.js}"></script>
<script th:src="@{/plugins/freedom-module-file.js}"></script>
<script type="text/javascript" th:inline="javascript">
    $(function () {
        var uploadUrl = [[${action}]];
        $.module.file.init({
            id: "upload",
            uploadUrl: uploadUrl,
            callback: function(data) {
                var resp = data.response;
                if (resp.success) {
                    window.parent.$.freedom.ui.table.refreshData();
                } else {
                    $.freedom.modal.msg(resp.msg);
                }
            }
        });
    });
</script>
</body>
</html>
